#!/usr/bin/env python3
# Copyright (C) 2018 Alyssa Rosenzweig <alyssa@rosenzweig.io>
# Copyright (C) 2016-2018 nickolas360 <contact@nickolas360.com>
#
# This file is part of Pagamigo.
#
# Pagamigo is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pagamigo is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Pagamigo.  If not, see <http://www.gnu.org/licenses/>.

from setuptools import setup
import os

SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
REPO_URL = "https://notabug.org/alyssa/pagamigo"
DESC_REPLACEMENTS = {
    ".. _LICENSE: LICENSE":
        ".. _LICENSE: {}/blob/master/LICENSE".format(REPO_URL),
}


def long_description():
    with open(os.path.join(SCRIPT_DIR, "README.md"), encoding='utf-8') as f:
        lines = f.read().splitlines()
    result = []
    for line in lines:
        result.append(DESC_REPLACEMENTS.get(line, line) + "\n")
    return "".join(result)


setup(
    name="pagamigo",
    version="0.5.0",
    description=(
        "A free/libre program for making payments with PayPal"
    ),
    long_description=long_description(),
    url="https://notabug.org/alyssa/pagamigo",
    author="alyssa",
    author_email="alyssa@rosenzweig.io",
    license="GNU Affero General Public License v3 or later (AGPLv3+)",
    classifiers=[
        "Development Status :: 4 - Beta",
        "Topic :: Internet",
        "License :: OSI Approved :: "
        "GNU Affero General Public License v3 or later (AGPLv3+)",
        "Operating System :: OS Independent",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.4",
        "Programming Language :: Python :: 3.5",
        "Programming Language :: Python :: 3.6",
    ],
    keywords="paypal",
    packages=["pagamigo"],
    entry_points={
        "console_scripts": [
            "pagamigo=pagamigo.__main__:main",
        ],
    },
    install_requires=[
        "requests>=2.18.1",
        "lxml>=4.2.3",
        "cssselect>=1.0.3"
    ],
)
